import { App } from 'vue'

import { formatUtcString } from '@/utils/date-format'
import { formatPlays } from '@/utils/plays-format'
import { formatMusicTime } from '@/utils/music-time-format'

export default function registerProperties(app: App) {
  //挂在到vue原型上
  app.config.globalProperties.$filters = {
    formatTime(value: string) {
      return formatUtcString(value, 'YYYY-MM-DD')
    },
    formatPlays(plays: number) {
      return formatPlays(plays)
    },
    formatMusicTime(times: number) {
      return formatMusicTime(times)
    }
  }
}
